import requests
resp = requests.get("http://www.baidu.com/")
print(resp.status_code)
print(resp.url)
print(resp.encoding)
resp.encoding = 'UTF-8'
print(resp.headers)
print(resp.headers.get("Content-Type"))
print(resp.text)